/**
 * api管理
 */
import request from './../utils/request'
import adminRequest from '../utils/adminRequest.js'

export default {
    // 登录获取验证码
    getLoginCode(params) {
        return adminRequest({
            url: '/authCenter/auth/sentLoginVerityCode',
            method: 'get',
            params,
            mock: false
        })
    },
    // 验证码登录
    codeLogin(data) {
        return adminRequest({
            url: '/authCenter/oauth/token',
            method: 'POST',
            data,
            mock: false,
        })
    },
    //登录注册完成之后需要调用这个接口
    pointsRegister(data){
        return request({
            url: '/base/integral/account/create',
            method: 'POST',
            data,
            mock: false,
        })
    },
    // 获取用户信息
    getUserinfo(params) {
        return adminRequest({
            url: '/authCenter/api/getMemberInfo',
            method: 'GET',
            params,
            mock: false,
        })
    },
    // // //登录注册完成之后需要调用这个接口 保存会员到R29
    afterLogin(data) {
        return request({
            url: '/base/member/save',
            method: 'POST',
            data,
            mock: false,
        })
    },
    // 退出登录
    logout(params) {
        return adminRequest({
            url: '/authCenter/api/logout',
            method: 'GET',
            params,
            mock: false,
        })
    },
    // 首页-优质景区-精选景区
    getSelectedScenicSpots(params) {
        return request({
            url: '/miniApp/noOauth/getSelectedScenicSpotList',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 首页-熊猫优服景点列表
    getPandaScenicList(params) {
        return adminRequest({
            url: '/ticket-app/ticketApp/goods/scenic/spotlist',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 首页-熊猫优服景点列表
    getSearchPandaScenicList(params) {
        return adminRequest({
            url: '/wl-portal/portal/goods/all/list',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 首页-轮播
    getBannerList(params) {
        return request({
            url: '/miniApp/noOauth/advertisementList',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 全部景区、优质景区列表、搜索接口
    getScenicSpotsList(params) {
        return request({
            url: '/miniApp/noOauth/scenicSpotList',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 首页景区列表
    getHomeScenicList(params) {
        return request({
            url: '/miniApp/noOauth/getSelectedScenicSpotList',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 全部景区、优质景区列表、搜索接口
    getSearch(params) {
        return request({
            url: '/miniApp/noOauth/list',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 酒店列表
    getHotelList(params) {
        return request({
            url: '/hotelApp/noOauth/scenicSpotList',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 首页酒店列表
    getHomeHotelList(params) {
        return request({
            url: '/hotelApp/noOauth/getSelectedScenicSpotList',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 全部火锅、优质火锅列表
    getHotPotList(params) {
        return request({
            url: '/cateringApp/noOauth/scenicSpotList',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 首页火锅列表
    getHomeHotPotList(params) {
        return request({
            url: '/cateringApp/noOauth/getSelectedScenicSpotList',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 模糊查询综合数据接口
    getSearchList(params) {
        return request({
            url: `/miniApp/search/list`,
            method: 'get',
            params,
        })
    },
    // 查询搜索历史
    getSearchHistoryList(params) {
        return request({
            url: `/miniApp/history/list`,
            method: 'get',
            params,
        })
    },
    // 搜索热门列表
    getHotSearch(params) {
        return request({
            url: `/miniApp/noOauth/popularSearchesList`,
            method: 'get',
            params,
        })
    },
    // 删除搜索历史
    deleteSearchHistoryList(params) {
        return request({
            url: `/miniApp/history/delete`,
            method: 'PUT',
            params,
        })
    },
    // 根据商铺id查询商品分类列表及基本信息
    getClassificationList(params) {
        return request({
            url: `/miniApp/merchant/query/goods/classification`,
            method: 'get',
            params,
        })
    },
    // 根据商铺id查询商品分类列表及基本信息
    getClassificationCommodityList(params) {
        return request({
            url: `/miniApp/merchant/query/goods/list`,
            method: 'get',
            params,
        })
    },
    getScenicHighQualityMerchants(params) {
        return request({
            url: '/miniApp/scenicspot/merchant',
            method: 'get',
            params,
            mock: false,
        })
    },
    // 获取景点详情
    getDetailInfo(params) {
        return request({
            url: '/miniApp/noOauth/getScenicSpotDetailInfo',
            method: 'get',
            params,
        })
    },
    // 获取酒店详情
    getHotelDetailInfo(params) {
        return request({
            url: '/hotelApp/noOauth/getScenicSpotDetailInfo',
            method: 'get',
            params,
        })
    },
    // 获取熊猫优服景点详情
    getPandaScenicDetailInfo(spotId, params) {
        return adminRequest({
            url: `/ticket-app/ticketApp/goods/goods/spot/info/${spotId}`,
            method: 'get',
            params,
        })
    },
    // 获取熊猫优服订单详情
    getPandaOrderList(params) {
        return adminRequest({
            url: `/wl-portal/portal/order/list`,
            method: 'get',
            params,
        })
    },
    // 获取熊猫优服订单详情
    getPandaOrderDetail(params) {
        return adminRequest({
            url: `/wl-portal/portal/order/info`,
            method: 'get',
            params,
        })
    },
    // 获取熊猫优服景点下的所有票务
    getPandaScenicVoteList(params) {
        return adminRequest({
            url: `/ticket-app/ticketApp/goods/goods/list/keyword`,
            method: 'get',
            params,
        })
    },
    // 获取熊猫优服景点根据票id获取详情
    getPandaScenicVoteDetail(goodsId) {
        return adminRequest({
            url: `/ticket-app/ticketApp/goods/goods/info/${goodsId}`,
            method: 'get'
        })
    },
    // 获取熊猫优福核销码
    getPandaOrderCode(params) {
        return adminRequest({
            url: `/wl-portal/portal/order/new/destroy/code`,
            method: 'get',
            params
        })
    },
    // 获取文旅出行人id获取熊猫优福id
    getPandaTouristId(id) {
        return request({
            url: `/miniApp/card/doesItExist/${id}`,
            method: 'get'
        })
    },
    // 嗨耍/熊猫优福下单
    createScenicOrder(data) {
        return adminRequest({
            url: `/wl-portal/portal/order/ticket/save`,
            method: 'POST',
            data
        })
    },
    // 嗨耍/熊猫唤起H5支付url
    openH5PayUrl(data) {
        return adminRequest({
            url: `/wl-portal/portal/pay/call/h5-url`,
            method: 'POST',
            data
        })
    },
    // 获取景点分类列表
    getScenicCategoryList(params) {
        return request({
            url: '/base/doorclassifymanage/list',
            method: 'get',
            params,
        })
    },
    // 获取市区树
    getAddressDistrictTree(params) {
        return request({
            url: '/miniApp/noOauth/district/tree',
            method: 'get',
            params,
        })
    },

    // 获取店铺介绍信息
    getScenicMerchantsIntroduce(id, params) {
        return request({
            url: `/miniApp/marchantinfo/shop/introduce/info/${id}`,
            method: 'get',
            params,
        })
    },
    // 获取店铺景区列表
    getScenicMerchantsScenicList(params) {
        return request({
            url: `/miniApp/marchantinfo/shop/evaluate/info`,
            method: 'get',
            params,
        })
    },
    // 获取店铺评价信息
    getScenicMerchantsEvaluate(params) {
        return request({
            url: `/miniApp/marchantinfo/scenic/area`,
            method: 'get',
            params,
        })
    },
    // 根据商铺id查询商品分类列表及基本信息
    getScenicMerchantsCategoryList(params) {
        return request({
            url: `/miniApp/merchant/query/goods/classification`,
            method: 'get',
            params,
        })
    },
    //   获取个人出行人列表
    getapedestrian(params) {
        return request({
            url: `/miniApp/card/list`,
            method: 'get',
            params
        })
    },
    // 添加出行人
    addapedestrian(data) {
        return request({
            url: `/miniApp/card/save`,
            method: 'post',
            data
        })
    },
    // 更具id获取出行人信息
    getidapedestrian(params) {
        return request({
            url: `/miniApp/card/cardInfoById`,
            method: 'get',
            params
        })
    },
    // 编辑出行人信息
    editapedestrian(data) {
        return request({
            url: `/miniApp/card/update`,
            method: 'put',
            data
        })
    },
    // 删除出行人信息 
    delidapedestrian(params) {
        return request({
            url: `/miniApp/card/delete`,
            method: 'get',
            params
        })
    },
    // 获取出行人证件类型
    gettypeCode(params) {
        return request({
            url: `/miniApp/card/list/cardType`,
            method: 'get',
            params
        })
    },
    // 更具商品id获取不同商品预订时间 
    getScenicSpotid(params) {
        return request({
            url: `/miniApp/scenicspot/intendedScenicSpot`,
            method: 'get',
            params
        })
    },
    // 景区提交预订
    getReserveTickets(params) {
        return request({
            url: `/miniApp/scenicspot/reserveTickets`,
            method: 'get',
            params
        })
    },
    // 火锅商品领取
    getReceiveCateringAppTickets(data) {
        return request({
            url: `/cateringApp/order/ticket/save`,
            method: 'post',
            data
        })
    },
    // 创建订单获取订单号
    orderpaymentsave(data) {
        return request({
            url: `/miniApp/order/ticket/save`,
            method: 'post',
            data
        })
    },
    // 创建优惠券订单获取订单号
    couponorderpaymentsave(data) {
        return request({
            url: `/miniApp/order/coupon/save`,
            method: 'post',
            data
        })
    },
    // 活动/共享 根据订单号获取订单支付id
    getPayld(data) {
        return request({
            url: `/miniApp/pay/call/getPayId`,
            method: 'post',
            data
        })
    },
    // 景点更具订单号获取订单支付id
    gethotelAppPayld(data) {
        return request({
            url: `/hotelApp/pay/call/getPayId`,
            method: 'post',
            data
        })
    },
    // 酒店更具订单号获取订单支付id
    getHotelPayId(data) {
        return request({
            url: `/hotelApp/pay/call/getPayId`,
            method: 'post',
            data
        })
    },
    // 获取景点票务订单列表
    getScenicOrderList(params) {
        return request({
            url: `/miniApp/order/ticketList`,
            method: 'get',
            params
        })
    },
    // 获取优惠券订单列表
    getCouponOrderList(params) {
        return request({
            url: `/miniApp/order/coupon/list`,
            method: 'get',
            params
        })
    },
    // 获取酒店订单列表
    getHotelOrderList(params) {
        return request({
            url: `/hotelApp/order/ticketList`,
            method: 'get',
            params
        })
    },
    // 获取活动订单列表
    getHotPotOrderList(params) {
        return request({
            url: `/cateringApp/order/ticketList`,
            method: 'get',
            params
        })
    },
    // 获取共享办公室小时卡价格
    getWorkHourPrice(data) {
        return request({
            url: '/miniApp/noOauth/calculate',
            method: 'post',
            data
        })
    },
    // 获取社区商店订单列表
    //     'goodsType': goodsType,
    // 'keyWord': keyWord,
    // 'pageNum': pageNum,
    // 'pageSize': pageSize,
    // 'status': status
    getMallOrderList(params) {
        return adminRequest({
            url: `/wl-portal/portal/order/list`,
            method: 'get',
            params: {...params, goodsType: 1}
        })
    },
    // 获取景点订单详情
    getOrderInfo(params) {
        return request({
            url: `/miniApp/order/info`,
            method: 'get',
            params
        })
    },
    // 获取优惠券订单详情
    getCouponOrderInfo(params) {
        return request({
            url: `/miniApp/order/coupon/info`,
            method: 'get',
            params
        })
    },
    // 获取活动订单详情
    getCateringOrderInfo(params) {
        return request({
            url: `/cateringApp/order/info`,
            method: 'get',
            params
        })
    },
    // 获取酒店详情
    getOrderInfohotel(params) {
        return request({
            url: `/hotelApp/order/info`,
            method: 'get',
            params
        })
    },
    // 获取名胜古迹列表图片
    getclassifymanage(params) {
        return request({
            url: `/base/doorclassifymanage/list`,
            method: 'get',
            params
        })
    },
    // 获取景点票夹信息 
    getticketList(data) {
        return request({
            url: `/ticket/ticket/ticketList`,
            method: 'post',
            data
        })
    },
    //优惠券列表
    getCouponList(params) {
        return request({
            url: `/miniApp/noOauth/couponList`,
            method: 'get',
            params
        })
    },
    //优惠券详情
    getCouponDetail(params) {
        return request({
            url: `/miniApp/noOauth/couponDetail/${params.id}`,
            method: 'get',

        })
    },
    // 获取酒店票夹信息 
    gethotelAppticketList(data) {
        return request({
            url: `/hotelApp/ticket/info/ticketList`,
            method: 'post',
            data
        })
    },
    // 获取火锅票夹信息 
    gethotpotticketList(data) {
        return request({
            url: `/miniApp/ticket/info/ticketList`,
            method: 'post',
            data
        })
    },

    // 景区取消订单
    getcancel(data) {
        return request({
            url: `/miniApp/order/cancel`,
            method: 'post',
            data
        })
    },
    // 优惠券取消订单
    cancelCouponOrder(data) {
        return request({
            url: `/miniApp/order/coupon/cancel`,
            method: 'post',
            data
        })
    },
    // 酒店取消订单
    getHotelCancelOrder(data) {
        return request({
            url: `/hotelApp/order/cancel`,
            method: 'post',
            data
        })
    },

    // 进入酒店预定
    gethotelpot(params) {
        return request({
            url: `/hotelApp/scenicspot/reserveTickets`,
            method: 'get',
            params
        })
    },
    //创建酒店订单获取订单号
    gethotelpotsave(data) {
        return request({
            url: `/hotelApp/order/ticket/save`,
            method: 'post',
            data
        })
    },

    // 获取共享预约活动接口
    getSharedActivity(params) {
        return request({
            url: '/miniApp/noOauth/shareSpotList',
            method: 'get',
            params,
        })
    },
    // 获取小时卡时间段
    getHourPeriod(params) {
        return request({
            url: `/miniApp/noOauth/timeRange/${params}`,
            method: "get",
        })
    },
    //获取活动预约接口
    getActivityReservation(params) {
        return request({
            url: `/miniApp/noOauth/activeSpotList`,
            method: 'get',
            params,
            mock: false,
        })
    },

    // 更具火锅id获取商品详情 
    gethotpotpotsave(params) {
        return request({
            url: `cateringApp/noOauth/getScenicSpotDetailInfo`,
            method: 'get',
            params
        })
    },

    // 查询是否满足支付条件
    getIsCanPay(params) {
        return request({
            url: `/miniApp/order/pay/state`,
            method: 'get',
            params
        })
    },
    // 景区获取退款原因
    getScenicRefund(params) {
        return request({
            url: `/miniApp/order/refund/reason`,
            method: 'get',
            params
        })
    },
    // 酒店获取退款原因
    getHotelRefund(params) {
        return request({
            url: `/hotelApp/order/refund/reason`,
            method: 'get',
            params
        })
    },
    // 景区提交退款申请
    getScenicSubmitRefund(data) {
        return request({
            url: `/miniApp/order/ticket/submit/refund`,
            method: 'POST',
            data
        })
    },
    // 优惠券提交退款申请
    getCouponSubmitRefund(data) {
        return request({
            url: `/miniApp/order/coupon/submit/refund`,
            method: 'POST',
            data
        })
    },
    // 酒店提交退款申请
    getHotelSubmitRefund(data) {
        return request({
            url: `/hotelApp/order/ticket/submit/refund`,
            method: 'POST',
            data
        })
    },
    // 景区取消退款
    getScenicCancelRefund(params) {
        return request({
            url: `/miniApp/order/cancel/refund`,
            method: 'GET',
            params
        })
    },
    // 酒店取消退款
    getHotelCancelRefund(params) {
        return request({
            url: `/hotelApp/order/cancel/refund`,
            method: 'GET',
            params
        })
    },
    //获取首页卡片信息
    getHomeCard() {
        return request({
            url: `/card/card/home/card`,
            method: 'GET',
            // params
        })
    },
    // 激活年卡
    getCardActivate(data) {
        return request({
            url: `/card/card/activate`,
            method: 'POST',
            data
        })
    },
    // 文件上传
    getFileUpload(data) {
        return request({
            url: `/file/upload/single/file`,
            method: 'POST',
            data
        })
    },
    // 购买卡获得支付url
    getPayUrl(data) {
        return request({
            url: `/card/card/pay-url`,
            method: 'POST',
            data
        })
    },
    //查询我的年卡
    getMyCard() {
        return request({
            url: `/card/card/my-card`,
            method: 'GET'
        })
    },
    //查询首页单个卡信息
    getCardInfoApi(params) {
        return request({
            url: `/card/card/info`,
            method: 'GET',
            params
        })
    },
    //查询签约景区列表
    getSignedSpots() {
        return request({
            url: `/card/card/join/scenic`,
            method: 'GET',
        })
    },
    //查询签约景区详情
    getSignedSpot(params) {
        return request({
            url: `/card/card/scenic/info`,
            method: 'GET',
            params
        })
    },
    //获取入园码
    getMyCode(params) {
        return request({
            url: `/card/card/enter-code`,
            method: 'GET',
            params
        })
    },
    //卡订单列表
    getOrderList(params) {
        return request({
            url: `/card/card/order-list`,
            method: 'GET',
            params
        })
    },
    //卡订单列表
    getCancelOrder(params) {
        return request({
            url: `/card/card/cancel-order`,
            method: 'GET',
            params
        })
    },
    //订单详情
    getCardOrderInfo(params) {
        return request({
            url: `/card/card/order-info`,
            method: 'GET',
            params
        })
    },
    //卡订单列表
    getCardList(params) {
        return request({
            url: `/card/card/order-list`,
            method: 'GET',
            params
        })
    },
    //查询卡优惠券接口
    getCouponCardList(params) {
        return request({
            url: `/card/card-coupon/card-list`,
            method: 'GET',
            params
        })
    },
    //获取行政区域
    getDistrictApi(data) {
        return adminRequest(
            {
                url: '/wl-portal/portal/address/district/tree',
                params: {
                    'districtCode': data.districtCode || '',
                    'pid': data.pid || '',
                    'level': data.level || '',
                },
                method: 'GET'
            }
        )
    },
    //获取地址详情
    getAddressDetail(addressId) {
        return adminRequest({
            url: `/wl-portal/portal/address/info/${addressId}`,
            method: 'GET'
        })
    },
    //获取临时token
    getTmpToken() {
        return adminRequest({
            url: `/authCenter/api/generate/tmpcode?appCode=NYH-0021`,//todo 后期改成后台配置的app code
            method: 'GET'
        })
    },
    changeToken(){

    },
    //获取品牌列表
    getBrandList(params) {
        return request({
            url: `/miniApp/brand/list`,
            method: 'GET',
            params
        })
    },
    //获取品牌详情
    getBrandDetail(params, brandId) {
        return request({
            url: `/miniApp/brand/info/${brandId}`,
            method: 'GET',
            params
        })
    },
    //获取品牌标签列表
    getLabelList(params) {
        return request({
            url: `/miniApp/label/list/noPage`,
            method: 'GET',
            params
        })
    },
    //获取政务列表
    getGovernList(params) {
        return request({
            url: `/miniApp/OrganizationServices/list`,
            method: 'GET',
            params
        })
    },
    //获取政务详情
    getGovernDetail(params, id) {
        return request({
            url: `/miniApp/OrganizationServices/detail/${id}`,
            method: 'GET',
            params
        })
    },
    //获取便民服务列表
    // {
    //     "code": "",
    //     "data": {
    //         "currPage": 0,
    //         "list": [
    //             {
    //                 "address": "",
    //                 "basicInformation": "",
    //                 "busines": [],
    //                 "coverImage": "",
    //                 "coverImageUrl": "",
    //                 "distance": 0,
    //                 "id": 0,
    //                 "latitude": "",
    //                 "longitude": "",
    //                 "merchantName": "",
    //                 "price": 0,
    //                 "priceStandard": 0,
    //                 "reservationStatus": 0,
    //                 "reservationType": 0,
    //                 "scenicAreaName": ""
    //             }
    //         ],
    //         "pageSize": 0,
    //         "totalCount": 0,
    //         "totalPage": 0
    //     },
    //     "msg": "",
    //     "success": true
    // }
    // 预约类型，0-活动;1-办公室;2-会议室;3-健身房 4-便民服务洗护5-便民服务缝补6-便民服务理发"
    getConvenienceList(params) {
        return request({
            url: `/miniApp/noOauth/convenienceSpotList`,
            method: 'GET',
            params
        })
    },
    //便民订单列表
    getConvenienceOrderList(params) {
        return request({
            url: `/miniApp/convenience/list`,
            method: 'GET',
            params
        })
    },
    //获取微信js sdk签名

    getWxSig(params) {
        return adminRequest(
            {
                url: '/wl-portal/portal/pay/get/signature',
                method: 'GET',
                params
            }
        )
    },


    //获取退款详情
    getRefundInfo(params) {
        return request({
            url: `/miniApp/order/refund/info`,
            method: 'GET',
            params
        })
    },

    //获取退款list
    getRefundList(params) {
        return request({
            url: `/miniApp/order/refund/list`,
            method: 'GET',
            params
        })
    }


}